package com.concurrent.controller;

import com.concurrent.model.User;
import com.concurrent.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("/getUserList")
    public String getUserList(Model model){
        List<User> users = userService.selectList();
        model.addAttribute("user",users);
        return "/user/user_list";
    }
}
